-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add bulk transformations functionality #49
Add bulk transformations functionality #49
Conversation
3c1d169
to
aba8549
Compare
The general direction LGTM! |
aba8549
to
c1c3077
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM :)
@spec pad(non_neg_integer(), Tokenizers.Encoding.padding_opts()) :: | ||
{:pad, {non_neg_integer(), Tokenizers.Encoding.padding_opts()}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved option types directly to the relevant functions, so we no longer have that type. We can bring it back, but it's also fine to just say keyword()
since we point to the user to Encoding.pad/3
anyway :)
@spec pad(non_neg_integer(), Tokenizers.Encoding.padding_opts()) :: | |
{:pad, {non_neg_integer(), Tokenizers.Encoding.padding_opts()}} | |
@spec pad(non_neg_integer(), keyword()) :: {:pad, {non_neg_integer(), keyword()}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jonatanklosko I'm not sure that having opts inside function spec and not as a type is good idea (at least here). Using keyword()
removes the ElixirLS ability to autosuggest, while having full list of opts in every function is a duplication and can lead to inconsistency, when in the future commits one place will be updated and other - no. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I wasn't aware ElixirLS does that, I don't have strong opinion, but that's a fair argument. So in this case we can bring the type back to share it :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Co-authored-by: Jonatan Kłosko <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Bulk encoding transformations added as discussed here: #44 (comment)
Naming and API discussible. Hope I didn't miss something.